window.onload = function() {
				var APP_ID = 'eG22PNfwqck3fDTem41ACiNU-gzGzoHsz';
				var APP_KEY = 'Y8VoXz0cIzsJVbpctUAJXAAh';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
				var currentUser = AV.User.current();
			}

			$("#login").click(function() {
				var username = $("#nc").val();
				var pwd = $("#pwd").val();
				login(username, pwd);
			});

			function login(username, pwd) {
				AV.User.logIn(username, pwd).then(function(loginedUser) {
					var href = geturlitem(location.search, "RetUrl");
					var biao = geturlitem(location.search, "biao");
					var id = geturlitem(location.search, "id");
					location.href = (geturl() == "") ? "shouye.html" : href+"?biao="+biao+"&id="+id;
					console.log("成功");
					console.log(loginedUser);
				}, (function(error) {
					if(error.code==211){
						alert("用户名不存在");
					}else{
						alert("用户名与密码不匹配");
					}
					console.log(JSON.parse(error.responseText));
				}));
			};